/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"5DAFA148-0414-40AB-AC37-462D0943024A"}
 */
var f_abreviatura = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"7FC746BC-8485-49DD-B989-B1580FD61CAB"}
 */
var f_descripcion = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"31202A97-73C0-4DBD-88C1-DBCC1BD82DFA"}
 */
function ir_a_detalle(event) 
{
	globals.mostrarForm("hospitales_det"); 
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"24C05373-E56C-49AF-94DE-E142AC06856B"}
 * @AllowToRunInFind
 */
function buscar(event) 
{
	foundset.loadAllRecords();  
	if(controller.find() == false)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró Hospitales (find)','OK');
		return false; 
	}

	if (f_descripcion != null)
		descripcion = '#%' + f_descripcion + '%';

	if (f_abreviatura != null)
		abreviatura = '#%' + f_abreviatura + '%';
	

	var found = controller.search()
	if(found == 0)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró Hospitales en ese rango','OK');
	}
	return true;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"DA596251-BBA8-450D-B136-5DADC204A2CB"}
 */
function todos(event) 
{
	f_descripcion=null;
	f_abreviatura=null;
	buscar(null);
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"C16BE65C-34BB-4F6B-A693-FC412BD9EA6B"}
 */
function anular(event) 
{
	f_descripcion=null;
	f_abreviatura=null;
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B1050A93-CBDF-479D-8E88-A7BECF267A93"}
 */
function onRecordSelection(event) {
	globals.gpais = pais_id;
	globals.gregion = provincia_id;
}
